<template>
    <div :id="props.id"></div>
</template>
  
  <script lang="ts" setup> 
  import {  onMounted } from "vue";
  const props= defineProps({
    amisjson: {
      type: Object,
      required: true
    },
    id:{
      type: String,
      default: Math.random().toString(36).substring(2)
    }
  })
  onMounted(() => {
    // @ts-ignore
    const amis = amisRequire('amis/embed');
    amis.embed('#' + props.id, props.amisjson);
  })
  
  </script>
  